package com.yidu.qianfeng.signfor;

import com.yidu.qianfeng.common.bean.transport.TrackWaybill;
import com.yidu.qianfeng.service.TrackWaybillService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * @Author: 张磊
 * @Description:
 * @Date Created in 9:27 2021/4/21
 * @since 1.0
 */
public class SignforController {

    @Resource(name = "trackWaybillServiceImpl")
    private TrackWaybillService trackWaybillService;

    /**
     * 查询已签收的订单信息
     * @param page 页面
     * @param limit 页目
     * @return map集合对象
     */
    @RequestMapping("/selectSignforPaing")
    public @ResponseBody
    Map selectSignforPaing(int page, int limit){

        Map map = new HashMap();
        map.put("code",0);
        map.put("msg","");
        map.put("count",trackWaybillService.selectSignforCount());
        map.put("data",trackWaybillService.selectSignforPaing((page-1)*limit,limit));

        return map;
    }

    /**
     * 根据托运单号搜索跟踪表数据
     * @param trackConsignNum 托运单号
     * @return map集合
     */
    @RequestMapping("/bytrackConsignNumSelect")
    public @ResponseBody Map bytrackConsignNumSelect(String trackConsignNum){

        Map map = new HashMap();
        map.put("code",0);
        map.put("msg","");
        map.put("count",trackWaybillService.bytrackConsignNumSelect(trackConsignNum));
        map.put("data",trackWaybillService.bytrackConsignNumSelect(trackConsignNum));

        return map;
    }

    @RequestMapping("/addSignfor")
    public void addSignfor(TrackWaybill trackWaybill){
        System.out.println(trackWaybill.toString());
    }
}
